package com.zys.el.user.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zys.el.core.service.impl.CrudServiceImpl;
import com.zys.el.user.po.TargetUser;
import com.zys.el.user.service.ITargetUserService;
import org.springframework.stereotype.Service;

@Service
public class TargetUserServiceImpl extends CrudServiceImpl<TargetUser> implements ITargetUserService {
    @Override
    public TargetUser selectTargetByUserId(Long userId) {

        QueryWrapper<TargetUser> qw = new QueryWrapper<>();
        qw.eq("user_id_", userId);
        qw.eq("delete_", 0);
        return getBaseMapper().selectOne(qw);
    }

    @Override
    public TargetUser selectTargetByTargetId(Long targetId) {

        QueryWrapper<TargetUser> qw = new QueryWrapper<>();
        qw.eq("target_id_", targetId);
        return getBaseMapper().selectOne(qw);
    }


}
